package org.black.phoneUtility.sms.reply.app.activity;

import org.black.phoneUtility.R;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyReplyTimesModeLimitedTimesDialogFragment;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyReplyTimesModeDialogFragment;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyDelayTimeForMissedCallDialogFragment;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyAddEditFragment;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyAddEditMatchSmsKeywordDialogFragment;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyAddEditNumberUserInputDialogFragment;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyAddEditNumberUserInputDialogFragment.AddEditPhoneNumberFor;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyDelayTimeForSmsDialogFragment;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyEditMessageDialogFragment;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyEditMessageDialogFragment.MessageFor;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyNoneReplyNumberAddNumberDialogFragment;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyNoneReplyNumberFromListFragment;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyReplyDateTimeAlwaysFragment;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyReplyDateTimeDialogFragment;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyReplyDateTimeDialogFragment.ReplyDateTimeType;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyReplyDateTimeExpiredAfterDialogFragment;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyReplyDateTimePeriodDatePickerDialogFragment;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyReplyDateTimePeriodDialogFragment;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyReplyDateTimePeriodTimePickerDialogFragment;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyReplyDateTimeRepeatDialogFragment;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyReplyDateTimeRepeatTimePickerDialogFragment;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyReplyToSpecificNumberAddNumberDialogFragment;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyReplyToSpecificNumberFromListFragment;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyResponseNumberAddNumberDialogFragment;
import org.black.phoneUtility.sms.reply.app.fragment.SmsReplyResponseNumberFromListFragment;
import org.black.phoneUtility.sms.reply.database.dataModel.SmsReply;

import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Intent;
import android.os.Bundle;
import android.view.MenuItem;

public class SmsReplyAddEditFragmentActivity extends Activity
		implements
		SmsReplyReplyDateTimeRepeatTimePickerDialogFragment.SmsReplyReplyDateTimeRepeatTimePickerInterface,
		SmsReplyReplyDateTimePeriodTimePickerDialogFragment.SmsReplyReplyDateTimePeriodTimePickerInterface,
		SmsReplyReplyDateTimePeriodDatePickerDialogFragment.SmsReplyReplyDateTimePeriodDatePickerInterface,
		SmsReplyEditMessageDialogFragment.SmsReplyEditMessageListener,
		SmsReplyReplyDateTimeDialogFragment.SmsReplyReplyDateTimeListener,
		SmsReplyReplyDateTimeAlwaysFragment.SmsReplyReplyDateTimeAlwaysListener,
		SmsReplyReplyDateTimeExpiredAfterDialogFragment.SmsReplyReplyDateTimeExpiredAfterListener,
		SmsReplyReplyDateTimePeriodDialogFragment.SmsReplyReplyDateTimePeriodListener,
		SmsReplyReplyDateTimeRepeatDialogFragment.SmsReplyReplyDateTimeRepeatListener,
		SmsReplyAddEditNumberUserInputDialogFragment.SmsReplyAddEditNumberUserInputInterface,
		SmsReplyResponseNumberAddNumberDialogFragment.SmsReplyResponseNumberAddNumberInterface,
		SmsReplyReplyToSpecificNumberAddNumberDialogFragment.SmsReplyReplyToSpecificNumberAddNumberInterface,
		SmsReplyNoneReplyNumberAddNumberDialogFragment.SmsReplyNoneReplyNumberAddNumberInterface,
		SmsReplyAddEditMatchSmsKeywordDialogFragment.SmsReplyAddEditMatchSmsKeywordDialogFragmentInterface,
		SmsReplyDelayTimeForSmsDialogFragment.SmsReplyDelayTimeForSmsDialogListener,
		SmsReplyDelayTimeForMissedCallDialogFragment.SmsReplyDelayTimeForMissedCallDialogListener,
		SmsReplyReplyTimesModeDialogFragment.SmsReplyTimesModeDialogFragmentListener,
		SmsReplyReplyTimesModeLimitedTimesDialogFragment.SmsReplyReplyTimesModeLimitedTimesDialogInterface {
	public static final String TAG = SmsReplyAddEditFragmentActivity.class
			.getName();

	public static final String ARGUMENTS_SMS_REPLY_ID = "smsReplyId";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.sms_reply_add_edit_main);
		FragmentManager fragmentManager = getFragmentManager();
		Fragment fragment = new SmsReplyAddEditFragment();

		Intent intent = getIntent();
		Bundle bundle = intent.getExtras();
		fragment.setArguments(bundle);

		fragmentManager
				.beginTransaction()
				.replace(R.id.sms_reply_add_edit_main_content_frame, fragment,
						SmsReplyAddEditFragment.TAG).commit();

		getActionBar().setDisplayHomeAsUpEnabled(true);
	}

	@Override
	protected void onResume() {
		super.onResume();
	}

	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		return super.onOptionsItemSelected(item);
	}

	@Override
	public void onBackPressed() {
		Fragment contentFragment = getFragmentManager().findFragmentById(
				R.id.sms_reply_add_edit_main_content_frame);
		if (contentFragment instanceof SmsReplyAddEditFragment) {
			SmsReplyAddEditFragment smsReplyAddEditFragment = (SmsReplyAddEditFragment) contentFragment;
			smsReplyAddEditFragment.insertOrUpdateSmsReply();
		}
		super.onBackPressed();
	}

	@Override
	public void onEditMessageDialogPositiveClick(MessageFor messageFor,
			String originalMessage, String newMessage) {
		SmsReplyAddEditFragment smsReplyAddEditFragment = (SmsReplyAddEditFragment) getFragmentManager()
				.findFragmentById(R.id.sms_reply_add_edit_main_content_frame);
		smsReplyAddEditFragment.updateMessage(messageFor, newMessage);
	}

	@Override
	public void onEditMessageDialogNegativeClick() {
	}

	@Override
	public void onChooseReplyDurationType(ReplyDateTimeType replyDateTimeType) {
		SmsReplyAddEditFragment smsReplyAddEditFragment = (SmsReplyAddEditFragment) getFragmentManager()
				.findFragmentById(R.id.sms_reply_add_edit_main_content_frame);

		smsReplyAddEditFragment.handleReplyDateTimeType(replyDateTimeType);
	}

	@Override
	public void onChooseReplyDateTimeAlways(SmsReply replyDateTimeModeAlways) {
		SmsReplyAddEditFragment smsReplyAddEditFragment = (SmsReplyAddEditFragment) getFragmentManager()
				.findFragmentById(R.id.sms_reply_add_edit_main_content_frame);
		smsReplyAddEditFragment
				.handleReplyDateTimeMode(replyDateTimeModeAlways);

	}

	@Override
	public void onReplyDateTimeExpiredAfterPositiveClick(
			SmsReply replyDateTimeModeExpiredAfter) {
		SmsReplyAddEditFragment smsReplyAddEditFragment = (SmsReplyAddEditFragment) getFragmentManager()
				.findFragmentById(R.id.sms_reply_add_edit_main_content_frame);
		smsReplyAddEditFragment
				.handleReplyDateTimeMode(replyDateTimeModeExpiredAfter);
	}

	@Override
	public void onReplyDateTimePeriodDialogNegativeClick() {
	}

	@Override
	public void onReplyDateTimePeriodDialogPositiveClick(
			SmsReply replyDateTimeModePeriod) {
		SmsReplyAddEditFragment smsReplyAddEditFragment = (SmsReplyAddEditFragment) getFragmentManager()
				.findFragmentById(R.id.sms_reply_add_edit_main_content_frame);
		smsReplyAddEditFragment
				.handleReplyDateTimeMode(replyDateTimeModePeriod);

	}

	@Override
	public void onReplyDateTimeRepeatDialogPositiveClick(
			SmsReply replyDateTimeModeRepeat) {
		SmsReplyAddEditFragment smsReplyAddEditFragment = (SmsReplyAddEditFragment) getFragmentManager()
				.findFragmentById(R.id.sms_reply_add_edit_main_content_frame);
		smsReplyAddEditFragment
				.handleReplyDateTimeMode(replyDateTimeModeRepeat);

	}

	@Override
	public void onReplyDateTimeRepeatDialogNegativeClick() {
	}

	@Override
	public void onChooseResponseNumberFromAllNumbers() {
		SmsReplyResponseNumberFromListFragment smsReplyResponseNumberFromListFragment = (SmsReplyResponseNumberFromListFragment) getFragmentManager()
				.findFragmentById(R.id.sms_reply_add_edit_main_content_frame);
		smsReplyResponseNumberFromListFragment.onChooseResponseNumberFromAll();
	}

	@Override
	public void onChooseResponseNumberFromAllNumbersInMyContacts() {
		SmsReplyResponseNumberFromListFragment smsReplyResponseNumberFromListFragment = (SmsReplyResponseNumberFromListFragment) getFragmentManager()
				.findFragmentById(R.id.sms_reply_add_edit_main_content_frame);
		smsReplyResponseNumberFromListFragment
				.onChooseResponseNumberFromAllNumbersInMyContacts();

	}

	@Override
	public void onChooseResponseNumberFromAllNumbersNotInMyContacts() {
		SmsReplyResponseNumberFromListFragment smsReplyResponseNumberFromListFragment = (SmsReplyResponseNumberFromListFragment) getFragmentManager()
				.findFragmentById(R.id.sms_reply_add_edit_main_content_frame);
		smsReplyResponseNumberFromListFragment
				.onChooseResponseNumberFromAllNumbersNotInMyContacts();
	}

	@Override
	public void onChooseResponseNumberFromChooseFromMyContacts() {
		SmsReplyResponseNumberFromListFragment smsReplyResponseNumberFromListFragment = (SmsReplyResponseNumberFromListFragment) getFragmentManager()
				.findFragmentById(R.id.sms_reply_add_edit_main_content_frame);
		smsReplyResponseNumberFromListFragment
				.onChooseResponseNumberFromContact();
	}

	@Override
	public void onChooseResponseNumberFromUserInput() {
		SmsReplyAddEditNumberUserInputDialogFragment smsReplyAddEditNumberUserInputDialogFragment = new SmsReplyAddEditNumberUserInputDialogFragment();
		Bundle bundle = new Bundle();
		bundle.putSerializable(
				SmsReplyAddEditNumberUserInputDialogFragment.ARGUMENTS_SMS_REPLY_ADD_EDIT_NUMBER_FROM,
				SmsReplyAddEditNumberUserInputDialogFragment.AddEditPhoneNumberFor.RESPONSE_NUMBER);
		smsReplyAddEditNumberUserInputDialogFragment.setArguments(bundle);
		smsReplyAddEditNumberUserInputDialogFragment.show(getFragmentManager(),
				SmsReplyAddEditNumberUserInputDialogFragment.TAG);
	}

	@Override
	public void onChooseResponseNumberFromSmsMessagesContainKeyword() {
		SmsReplyAddEditMatchSmsKeywordDialogFragment smsReplyAddEditMatchSmsKeywordDialogFragment = new SmsReplyAddEditMatchSmsKeywordDialogFragment();
		Bundle bundle = new Bundle();
		bundle.putSerializable(
				SmsReplyAddEditMatchSmsKeywordDialogFragment.ARGUMENTS_SMS_REPLY_ADD_EDIT_MATCH_SMS_KEYWORDS_COME_FROM,
				SmsReplyAddEditMatchSmsKeywordDialogFragment.MATCH_SMS_KEYWORDS_COME_FROM_RESPONSE_NUMBER_FROM);
		smsReplyAddEditMatchSmsKeywordDialogFragment.setArguments(bundle);
		smsReplyAddEditMatchSmsKeywordDialogFragment.show(getFragmentManager(),
				SmsReplyAddEditMatchSmsKeywordDialogFragment.TAG);
	}

	@Override
	public void onChooseResponseNumberFromNumbersFromContactGroup() {
		SmsReplyResponseNumberFromListFragment smsReplyResponseNumberFromListFragment = (SmsReplyResponseNumberFromListFragment) getFragmentManager()
				.findFragmentById(R.id.sms_reply_add_edit_main_content_frame);
		smsReplyResponseNumberFromListFragment
				.onChooseResponseNumbersFromNumbersFromContactGroup();
	}

	@Override
	public void onChooseSmsReplyAddEditNumberUserInputDialogPositiveClick(
			AddEditPhoneNumberFor addEditPhoneNumberFor, String phoneNumber) {
		if (AddEditPhoneNumberFor.RESPONSE_NUMBER.equals(addEditPhoneNumberFor) == true) {
			SmsReplyResponseNumberFromListFragment smsReplyResponseNumberFromListFragment = (SmsReplyResponseNumberFromListFragment) getFragmentManager()
					.findFragmentById(
							R.id.sms_reply_add_edit_main_content_frame);
			smsReplyResponseNumberFromListFragment
					.handleAddChooseFromUserInput(phoneNumber);
		} else if (AddEditPhoneNumberFor.NONE_REPLY
				.equals(addEditPhoneNumberFor) == true) {
			SmsReplyNoneReplyNumberFromListFragment smsReplyNoneReplyNumberFromListFragment = (SmsReplyNoneReplyNumberFromListFragment) getFragmentManager()
					.findFragmentById(
							R.id.sms_reply_add_edit_main_content_frame);
			smsReplyNoneReplyNumberFromListFragment
					.handleChooseFromUserInput(phoneNumber);
		} else if (AddEditPhoneNumberFor.REPLY_TO_SPECIFIC
				.equals(addEditPhoneNumberFor) == true) {
			SmsReplyReplyToSpecificNumberFromListFragment smsReplyReplyToSpecificNumberFromListFragment = (SmsReplyReplyToSpecificNumberFromListFragment) getFragmentManager()
					.findFragmentById(
							R.id.sms_reply_add_edit_main_content_frame);
			smsReplyReplyToSpecificNumberFromListFragment
					.handleChooseFromUserInput(phoneNumber);
		}
	}

	@Override
	public void onChooseSmsReplyAddEditNumberUserInputDialogNegativeClick() {
	}

	@Override
	public void onChooseReplyToSpecificNumberFromContact() {
		SmsReplyReplyToSpecificNumberFromListFragment smsReplyReplyToSpecificNumberFromListFragment = (SmsReplyReplyToSpecificNumberFromListFragment) getFragmentManager()
				.findFragmentById(R.id.sms_reply_add_edit_main_content_frame);
		smsReplyReplyToSpecificNumberFromListFragment
				.onChooseReplyToSpecificNumberFromContact();
	}

	@Override
	public void onChooseReplyToSpecificNumberFromUserInput() {
		SmsReplyAddEditNumberUserInputDialogFragment smsReplyAddEditNumberUserInputDialogFragment = new SmsReplyAddEditNumberUserInputDialogFragment();
		Bundle bundle = new Bundle();
		bundle.putSerializable(
				SmsReplyAddEditNumberUserInputDialogFragment.ARGUMENTS_SMS_REPLY_ADD_EDIT_NUMBER_FROM,
				SmsReplyAddEditNumberUserInputDialogFragment.AddEditPhoneNumberFor.REPLY_TO_SPECIFIC);
		smsReplyAddEditNumberUserInputDialogFragment.setArguments(bundle);
		smsReplyAddEditNumberUserInputDialogFragment.show(getFragmentManager(),
				SmsReplyAddEditNumberUserInputDialogFragment.TAG);
	}

	@Override
	public void onChooseReplyToSpecificNumberNumbersFromContactGroup() {
		SmsReplyReplyToSpecificNumberFromListFragment smsReplyReplyToSpecificNumberFromListFragment = (SmsReplyReplyToSpecificNumberFromListFragment) getFragmentManager()
				.findFragmentById(R.id.sms_reply_add_edit_main_content_frame);
		smsReplyReplyToSpecificNumberFromListFragment
				.onChooseReplyToSpecificNumberFromNumbersFromContactGroup();

	}

	@Override
	public void onChooseNoneReplyNumberFromContacts() {
		SmsReplyNoneReplyNumberFromListFragment smsReplyNoneReplyNumberFromListFragment = (SmsReplyNoneReplyNumberFromListFragment) getFragmentManager()
				.findFragmentById(R.id.sms_reply_add_edit_main_content_frame);
		smsReplyNoneReplyNumberFromListFragment
				.onChooseNoneReplyNumberFromAllInMyContacts();

	}

	@Override
	public void onChooseNoneReplyeNumberFromContact() {
		SmsReplyNoneReplyNumberFromListFragment smsReplyNoneReplyNumberFromListFragment = (SmsReplyNoneReplyNumberFromListFragment) getFragmentManager()
				.findFragmentById(R.id.sms_reply_add_edit_main_content_frame);
		smsReplyNoneReplyNumberFromListFragment
				.onChooseNoneReplyNumberFromContact();
	}

	@Override
	public void onChooseNoneReplyNumberFromUserInput() {
		SmsReplyAddEditNumberUserInputDialogFragment smsReplyAddEditNumberUserInputDialogFragment = new SmsReplyAddEditNumberUserInputDialogFragment();
		Bundle bundle = new Bundle();
		bundle.putSerializable(
				SmsReplyAddEditNumberUserInputDialogFragment.ARGUMENTS_SMS_REPLY_ADD_EDIT_NUMBER_FROM,
				SmsReplyAddEditNumberUserInputDialogFragment.AddEditPhoneNumberFor.NONE_REPLY);
		smsReplyAddEditNumberUserInputDialogFragment.setArguments(bundle);
		smsReplyAddEditNumberUserInputDialogFragment.show(getFragmentManager(),
				SmsReplyAddEditNumberUserInputDialogFragment.TAG);
	}

	@Override
	public void onChooseNoneReplyNumberFromSmsMessagesContainKeyword() {
		SmsReplyAddEditMatchSmsKeywordDialogFragment smsReplyAddEditMatchSmsKeywordDialogFragment = new SmsReplyAddEditMatchSmsKeywordDialogFragment();
		Bundle bundle = new Bundle();
		bundle.putSerializable(
				SmsReplyAddEditMatchSmsKeywordDialogFragment.ARGUMENTS_SMS_REPLY_ADD_EDIT_MATCH_SMS_KEYWORDS_COME_FROM,
				SmsReplyAddEditMatchSmsKeywordDialogFragment.MATCH_SMS_KEYWORDS_COME_FROM_NONE_RESPONSE_NUMBER);
		smsReplyAddEditMatchSmsKeywordDialogFragment.setArguments(bundle);
		smsReplyAddEditMatchSmsKeywordDialogFragment.show(getFragmentManager(),
				SmsReplyAddEditMatchSmsKeywordDialogFragment.TAG);

	}

	@Override
	public void onChooseNoneReplyNumberFromNumbersFromContactGroup() {
		SmsReplyNoneReplyNumberFromListFragment smsReplyNoneReplyNumberFromListFragment = (SmsReplyNoneReplyNumberFromListFragment) getFragmentManager()
				.findFragmentById(R.id.sms_reply_add_edit_main_content_frame);
		smsReplyNoneReplyNumberFromListFragment
				.onChooseNoneReplyNumberFromNumbersFromContactGroup();
	}

	@Override
	public void onReplyDateTimePeriodDatePickerDialogPositiveClick(
			boolean isBegin, int year, int monthOfYear, int dayOfMonth) {
		SmsReplyReplyDateTimePeriodDialogFragment smsReplyReplyDateTimePeriodDialogFragment = (SmsReplyReplyDateTimePeriodDialogFragment) getFragmentManager()
				.findFragmentByTag(
						SmsReplyReplyDateTimePeriodDialogFragment.TAG);
		smsReplyReplyDateTimePeriodDialogFragment
				.handlePeriodDatePickerSelection(isBegin, year, monthOfYear,
						dayOfMonth);
	}

	@Override
	public void onReplyDateTimePeriodDatePickerDialogNegativeClick() {
	}

	@Override
	public void onReplyDateTimeRepeatTimePickerDialogPositiveClick(
			boolean isBegin, int hourOfDay, int minute) {
		SmsReplyReplyDateTimeRepeatDialogFragment smsReplyReplyDateTimePeriodDialogFragment = (SmsReplyReplyDateTimeRepeatDialogFragment) getFragmentManager()
				.findFragmentByTag(
						SmsReplyReplyDateTimeRepeatDialogFragment.TAG);
		smsReplyReplyDateTimePeriodDialogFragment.handleTimePickerSelection(
				isBegin, hourOfDay, minute);
	}

	@Override
	public void onReplyDateTimeRepeatTimePickerDialogNegativeClick() {
	}

	@Override
	public void onReplyDateTimePeriodTimePickerDialogPositiveClick(
			boolean isBegin, int hourOfDay, int minute) {
		SmsReplyReplyDateTimePeriodDialogFragment smsReplyReplyDateTimePeriodDialogFragment = (SmsReplyReplyDateTimePeriodDialogFragment) getFragmentManager()
				.findFragmentByTag(
						SmsReplyReplyDateTimePeriodDialogFragment.TAG);
		smsReplyReplyDateTimePeriodDialogFragment
				.handlePeriodTimePickerSelection(isBegin, hourOfDay, minute);

	}

	@Override
	public void onSmsReplyAddEditMatchSmsKeywordDialogFragmentPositiveClick(
			int matchSmsKeywordFor, String keyword, boolean onAdding) {
		if (matchSmsKeywordFor == SmsReplyAddEditMatchSmsKeywordDialogFragment.MATCH_SMS_KEYWORDS_COME_FROM_RESPONSE_NUMBER_FROM) {
			SmsReplyResponseNumberFromListFragment smsReplyResponseNumberFromListFragment = (SmsReplyResponseNumberFromListFragment) getFragmentManager()
					.findFragmentById(
							R.id.sms_reply_add_edit_main_content_frame);
			if (onAdding == true) {
				smsReplyResponseNumberFromListFragment
						.handleAddChooseFromMatchMessageWithKeywords(keyword);
			} else {
				smsReplyResponseNumberFromListFragment
						.handleUpdateChooseFromMatchMessageWithKeywords();
			}
		} else if (matchSmsKeywordFor == SmsReplyAddEditMatchSmsKeywordDialogFragment.MATCH_SMS_KEYWORDS_COME_FROM_NONE_RESPONSE_NUMBER) {
			SmsReplyNoneReplyNumberFromListFragment smsReplyNoneReplyNumberFromListFragment = (SmsReplyNoneReplyNumberFromListFragment) getFragmentManager()
					.findFragmentById(
							R.id.sms_reply_add_edit_main_content_frame);
			if (onAdding == true) {
				smsReplyNoneReplyNumberFromListFragment
						.handleAddChooseFromMatchMessageWithKeywords(keyword);
			} else {
				smsReplyNoneReplyNumberFromListFragment
						.handleUpdateChooseFromMatchMessageWithKeywords();
			}
		}

	}

	@Override
	public void onSmsReplyAddEditMatchSmsKeywordDialogFragmentNegativeClick() {

	}

	@Override
	public void onSmsReplyDelayTimeDialogForSmsPositiveClick(long delayTime) {
		SmsReplyAddEditFragment smsReplyAddEditFragment = (SmsReplyAddEditFragment) getFragmentManager()
				.findFragmentById(R.id.sms_reply_add_edit_main_content_frame);
		smsReplyAddEditFragment.handleChooseDelayTimeForSms(delayTime);
	}

	@Override
	public void onSmsReplyDelayTimeDialogForSmsNegativeClick() {
	}

	@Override
	public void onSmsReplyDelayTimeDialogForMissedPositiveClick(long delayTime) {
		SmsReplyAddEditFragment smsReplyAddEditFragment = (SmsReplyAddEditFragment) getFragmentManager()
				.findFragmentById(R.id.sms_reply_add_edit_main_content_frame);
		smsReplyAddEditFragment.handleChooseDelayTimeForMissedCall(delayTime);
	}

	@Override
	public void onSmsReplyDelayTimeDialogForMissedNegativeClick() {
	}

	@Override
	public void onSmsReplyTimesModeDialogFragmentAlwaysClick() {
		SmsReplyAddEditFragment smsReplyAddEditFragment = (SmsReplyAddEditFragment) getFragmentManager()
				.findFragmentById(R.id.sms_reply_add_edit_main_content_frame);
		smsReplyAddEditFragment.handleChooseReplyTimesAlwaysReply();

	}

	@Override
	public void onSmsReplyTimesModeDialogFragmentLimitedTimesClick() {
		SmsReplyAddEditFragment smsReplyAddEditFragment = (SmsReplyAddEditFragment) getFragmentManager()
				.findFragmentById(R.id.sms_reply_add_edit_main_content_frame);
		smsReplyAddEditFragment.handleChooseReplyTimesLimitedTimes();

	}

	@Override
	public void onSmsReplyReplyTimesModeLimitedTimesDialogPositiveClick(
			int number) {
		SmsReplyAddEditFragment smsReplyAddEditFragment = (SmsReplyAddEditFragment) getFragmentManager()
				.findFragmentById(R.id.sms_reply_add_edit_main_content_frame);
		smsReplyAddEditFragment
				.handleChooseTimesOnReplyTimesLimitedTimesDialog(number);

	}

	@Override
	public void onSmsReplyReplyTimesModeLimitedTimesDialogNegativeClick() {
	}

}
